﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.IO;
using System.Xml.Linq;

namespace ThreeByte.ActiveDeck.Web
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IActiveDeckConfigService
    {

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "Resource/{presentation}/{fileName}")]
        XElement UploadResource(string presentation, string fileName, XElement resourceData);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "ResourceBlock/{presentation}/{fileName}?id={blockId}&md5={contentHash}")]
        XElement UploadResourceBlock(string presentation, string fileName, string blockId, string contentHash, XElement resourceData);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "CommitResource/{presentation}/{fileName}")]
        XElement CommitResourceBlocks(string presentation, string fileName, XElement blockList);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "GetResource/{presentation}/{fileName}")]
        Stream GetResource(string presentation, string fileName, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "GetResourceInfo/{presentation}/{resource}")]
        XElement GetResourceInfo(string presentation, string resource, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "GetResourceList/{presentation}/{count=null}/{skip=null}")]
        XElement GetResourceList(string presentation, string count, string skip, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "DeleteResources/{presentation}")]
        XElement DeleteResources(string presentation, XElement data);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "Publish/{presentation}")]
        XElement Publish(string presentation, XElement presentationData);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "PublishCompressed/{presentation}")]
        XElement PublishCompressed(string presentation, XElement presentationData);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "StartPresentation/{presentation}")]
        XElement StartPresentation(string presentation, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "EndPresentation/{presentation}")]
        XElement EndPresentation(string presentation, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "NewUser")]
        XElement NewUser(XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "GetStarted")]
        XElement EmailSignup(Stream stream);

        [OperationContract, WebGet(UriTemplate = "AddInVersion")]
        XElement GetAddInVersion();

        [OperationContract, WebGet(UriTemplate = "Download?x={responseGuid}")]
        Stream DownloadAddIn(string responseGuid);

        [OperationContract, WebGet(UriTemplate = "DownloadBeta?v={version}")]
        Stream DownloadBetaAddIn(string version);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "Download")]
        Stream DownloadAddInWithAuth(XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "Login")]
        XElement TestLogin(XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "AccountInfo/{username}")]
        XElement AccountInfo(string username, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "SetUserGroup/{presentation}")]
        XElement SetUserGroup(string presentation, XElement userData);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "RemoveUsersFromGroup/{presentation}")]
        XElement RemoveUsersFromGroup(string presentation, XElement userData);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "RemovePresentationGroups/{presentation}")]
        XElement RemovePresentationGroups(string presentation, XElement groupData);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "GetGroupUsers/{presentation}")]
        XElement GetGroupUsers(string presentation, XElement userData);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "Submit/{presentation}/{section}")]
        XElement Submit(string presentation, string section, XElement userData);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "SubmitErrorReport")]
        XElement SubmitErrorReport(XElement reportData);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "UserData/{presentation}/{section}/{page=null}")]
        XElement GetUserData(string presentation, string section, string page, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "GroupedUserData/{presentation}/{section}/{page=null}")]
        XElement GetGroupedUserData(string presentation, string section, string page, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "GetMultiQuestionGroupedUserData/{presentation}")]
        XElement GetMultiQuestionGroupedUserData(string presentation, XElement pages);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "GetUserDataReport/{presentation}")]
        XElement GetUserDataReport(string presentation, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "ResetUserData/{presentation}/{section}/{page}")]
        XElement ResetUserData(string presentation, string section, string page, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "ClearUserData/{presentation}")]
        XElement ClearAllUserData(string presentation, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "SetCurrentState/{presentation}/{section}")]
        XElement SetCurrentState(string presentation, string section, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "GetCurrentState/{presentation}")]
        XElement GetCurrentState(string presentation, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "NewPresentation/{presentation}")]
        XElement NewPresentation(string presentation, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "RenamePresentation/{presentation}/{name}")]
        XElement RenamePresentation(string presentation, string name, XElement auth);

        [OperationContract, WebInvoke(Method = "POST", UriTemplate = "GetPresentation/{presentation}")]
        XElement GetPresentation(string presentation, XElement auth);

        [OperationContract, WebGet(UriTemplate="GetPresentationInfo/{presentation}")]
        XElement GetPresentationInfo(string presentation);

        [OperationContract, WebGet(UriTemplate = "Logo/{presentation}")]
        Stream GetPresentationLogo(string presentation);


        //[OperationContract, WebInvoke(Method = "GET", UriTemplate = "Test")]
        //XElement Test();

    }


}
